export function createElement(tag,data={},...children){
  let key = data.key;
  if(key){
     delete data.key;
  }
  return vnode(tag,data,key,children,undefined);
}
export function createTextNode(text){
  console.log(text,'text')
  return vnode(undefined,undefined,undefined,undefined,text);
}

function vnode(tag,data,key,children,text){
    return {
      tag,
      data,
      key,
      children,
      text
    }
}
//将template转为ast语法树---生成render方法--生成虚拟dom--真实的dom
//页面更新：虚拟dom对比--更新dom

